<xsl:template match='/'>
\documentclass[12pt]{article}
\usepackage[dutch]{babel}
\usepackage[latin1]{inputenc}
\usepackage{array}
\usepackage[a4paper,tmargin=2cm,lmargin=0.5cm,landscape]{geometry}
\setlength{\textwidth}{28.5cm}
\setlength{\textheight}{19cm}
\setlength\arrayrulewidth{.1pt}
\renewcommand{\arraystretch}{1.35}
\setlength{\tabcolsep}{0.1cm}
\pagestyle{empty}
\begin{document}
\noindent
\parbox{28.5cm}{
\begin{tabular}{|p{9.29cm}&gt;{\centering}p{9.29cm}&gt;{\hfill}p{9.29cm}|}
\hline
\rule{0cm}{0.5cm}
\large <xsl:value-of select='//leerling/klas' />&amp;&amp; \large Sint-Ritacollege\\
\large <xsl:value-of select='//leerling/voornaam' />&#160;<xsl:value-of select='//leerling/achternaam' /> - (<xsl:value-of select='//leerling/klasnr' />) &amp;\large Jaarrapport&amp; \large <xsl:value-of select='//rapport/@jaar' />-<xsl:value-of select='//rapport/@jaar + 1' />\\
\hline
\end{tabular}}
\\[0.3cm]
\noindent
\parbox[t]{2cm}{\mbox{ }

\noindent
\begin{tabular}{|p{1.8cm}&lt;{\centering}|}
\hline
  \\
\hline
  \\
\hline
\hline
<xsl:for-each select="//vakken/*">
    <xsl:sort select="@volgNr" />
    <xsl:call-template name="vaknaam" />
</xsl:for-each>
\hline
\hline
AT \\
\hline
\end{tabular}}
\parbox[t]{4.4cm}{\mbox{ }

\noindent
\begin{tabular}{|>{\centering}p{0.9cm}|>{\centering}p{0.9cm}|>{\centering}p{0.9cm}|p{0.9cm}&lt;{\centering}|}
\hline
\multicolumn{4}{|c|}{Semester 1}\\
\hline
  DW &amp; EX &amp; TOT &amp; KG\\
\hline
\hline
<xsl:for-each select="//vakken/*">
    <xsl:sort select="@volgNr" />
    <xsl:call-template name="vakcijfers1" />
</xsl:for-each>
\hline
\hline
\multicolumn{2}{|c|}{Semester 1} &amp;<xsl:value-of select="//totaal/tottot1" /> &amp; <xsl:value-of select="//totaal/tottot1gem" /> \\
\hline
\end{tabular}}
\parbox[t]{4.4cm}{\mbox{ }

\noindent
\begin{tabular}{|>{\centering}p{0.9cm}|>{\centering}p{0.9cm}|>{\centering}p{0.9cm}|p{0.9cm}&lt;{\centering}|}
\hline
\multicolumn{4}{|c|}{Semester 2}\\
\hline
  DW &amp; EX &amp; TOT &amp; KG\\
\hline
\hline
<xsl:for-each select="//vakken/*">
    <xsl:sort select="@volgNr" />
    <xsl:call-template name="vakcijfers2" />
</xsl:for-each>
\hline
\hline
\multicolumn{2}{|c|}{Semester 2} &amp;<xsl:value-of select="//totaal/tottot2" /> &amp; <xsl:value-of select="//totaal/tottot2gem" /> \\
\hline
\end{tabular}}
\parbox[t]{2.4cm}{\mbox{ }

\noindent
\begin{tabular}{|>{\centering}p{0.9cm}|p{0.9cm}&lt;{\centering}|}
\hline
\multicolumn{2}{|c|}{Jaar   }\\
\hline
  TOT &amp; KG\\
\hline
\hline
<xsl:for-each select="//vakken/*">
    <xsl:sort select="@volgNr" />
    <xsl:call-template name="jaarcijfers" />
</xsl:for-each>
\hline
\hline
  <xsl:value-of select="//totaal/tottotj" />&amp;
  <xsl:value-of select="//totaal/tottotjgem" />\\
\hline
\end{tabular}}
\hfill
\parbox[t]{14.4cm}{\mbox{ }

\noindent 
\begin{tabular}{|cp{14cm}|}
\hline
\rule[-3.1cm]{0cm}{3.1cm}&amp;
{\bf &#160; <xsl:value-of select="substring(//beslissing/attest/@code,2,1)" /> attest: }
<xsl:value-of select="//beslissing/attest" />

<xsl:for-each select="//beslissing/waarschuwing/v">

   Waarschuwing voor <xsl:value-of select="." />.
</xsl:for-each> 
<xsl:for-each select="//beslissing/taak/v">

   Taak voor <xsl:value-of select="." />.
</xsl:for-each>
<xsl:for-each select="//beslissing/bijkomend/v">

   Bijkomende proef voor <xsl:value-of select="." />.
</xsl:for-each>
\\
\hline
\hline
\rule[-3.1cm]{0cm}{3.1cm}&amp;{\bf  &#160; Advies:} <xsl:value-of select="//beslissing/advies" />&#160; <xsl:value-of select="//beslissing/amendement" />
\\
\hline
\hline
\rule[-2.5cm]{0cm}{6.1cm}&amp;\\
\hline
\hline
\rule[-2.5cm]{0cm}{2.1cm}&amp;{\bf &#160; Herinschrijving 2007-2008: }

Het herinschrijvingsformulier moet ten laatste op 4 juli 2006 te 16 uur aan de directie van het Sint-Ritacollege bezorgd worden zoniet verliest de leerling het recht op inschrijving aan het Sint-Ritacollege.
Dit ten gevolge het decreet op de gelijke onderwijskansen.\\
\hline
\end{tabular}}
\end{document}
</xsl:template>

<xsl:template name="vaknaam">
 <xsl:value-of select="name()" /> - <xsl:value-of select="uren" />\\
\hline
</xsl:template>  

<xsl:template name="vakcijfers1">
 <xsl:value-of select="dw1" />&amp;<xsl:value-of select="ex1" />&amp;<xsl:value-of select="tot1" />&amp;<xsl:value-of select="tot1gem" />\\
\hline
</xsl:template>

<xsl:template name="vakcijfers2">
 <xsl:value-of select="dw2" />&amp;<xsl:value-of select="ex2" />&amp;<xsl:value-of select="tot2" />&amp;<xsl:value-of select="tot2gem" />\\
\hline
</xsl:template>

<xsl:template name="jaarcijfers">
 <xsl:value-of select="totj" />&amp;<xsl:value-of select="totjgem" />\\
\hline
</xsl:template>